package qing.entity;

import java.util.Date;

import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Version;

import org.hibernate.validator.constraints.NotBlank;

@Entity
@Table
public class Article {

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;	
	
	//貌似解决并发控制数据问题
	@Version
	private Integer version;
	
	private boolean deleted;
	
	//时间戳
	@Temporal(value=TemporalType.TIMESTAMP)
	private Date dateCreated;
	
	@NotBlank
	private String title;
	
	private String subtitle;
	
	@Column(updatable = false)
	private String adduser;
	
	private String lastuser;
	
	@Column(updatable = false,nullable=false,length=20)
	private Date addtime= new Date();
	
	@Temporal(value=TemporalType.TIMESTAMP)
	private Date lasttime;
	

	private int taxis=0;
	
	private String imgurl;
	
	private String linkurl;
	
	private boolean istj=false;
	
	private boolean istop=false;
	
	private boolean ispics=false;
	
	private boolean ishot=false;
	
	private int islock=0;
	
	@Basic(fetch=FetchType.LAZY)
	@Column(columnDefinition="nvarchar(MAX)")
	private String content;
	
	private String author;
	
	private String source;
	
	private String seotitle;
	
	private String seokeyword;
	
	private String seodescr;
	
	private int hit=0;
	
	private String summay;
	
	private String specialid;
	
	private String etdxml;
	
	private String tags;
	
	@ManyToOne
	@JoinColumn(name="nodeid")
	private Node node;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getVersion() {
		return version;
	}

	public void setVersion(Integer version) {
		this.version = version;
	}

	public boolean isDeleted() {
		return deleted;
	}

	public void setDeleted(boolean deleted) {
		this.deleted = deleted;
	}

	public Date getDateCreated() {
		return dateCreated;
	}

	public void setDateCreated(Date dateCreated) {
		this.dateCreated = dateCreated;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getSubtitle() {
		return subtitle;
	}

	public void setSubtitle(String subtitle) {
		this.subtitle = subtitle;
	}

	public String getAdduser() {
		return adduser;
	}

	public void setAdduser(String adduser) {
		this.adduser = adduser;
	}

	public String getLastuser() {
		return lastuser;
	}

	public void setLastuser(String lastuser) {
		this.lastuser = lastuser;
	}

	public Date getAddtime() {
		return addtime;
	}

	public void setAddtime(Date addtime) {
		this.addtime = addtime;
	}

	public Date getLasttime() {
		return lasttime;
	}

	public void setLasttime(Date lasttime) {
		this.lasttime = lasttime;
	}

	public int getTaxis() {
		return taxis;
	}

	public void setTaxis(int taxis) {
		this.taxis = taxis;
	}

	public String getImgurl() {
		return imgurl;
	}

	public void setImgurl(String imgurl) {
		this.imgurl = imgurl;
	}

	public String getLinkurl() {
		return linkurl;
	}

	public void setLinkurl(String linkurl) {
		this.linkurl = linkurl;
	}

	public boolean isIstj() {
		return istj;
	}

	public void setIstj(boolean istj) {
		this.istj = istj;
	}

	public boolean isIstop() {
		return istop;
	}

	public void setIstop(boolean istop) {
		this.istop = istop;
	}

	public boolean isIspics() {
		return ispics;
	}

	public void setIspics(boolean ispics) {
		this.ispics = ispics;
	}

	public boolean isIshot() {
		return ishot;
	}

	public void setIshot(boolean ishot) {
		this.ishot = ishot;
	}

	public int getIslock() {
		return islock;
	}

	public void setIslock(int islock) {
		this.islock = islock;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public String getSource() {
		return source;
	}

	public void setSource(String source) {
		this.source = source;
	}

	public String getSeotitle() {
		return seotitle;
	}

	public void setSeotitle(String seotitle) {
		this.seotitle = seotitle;
	}

	public String getSeokeyword() {
		return seokeyword;
	}

	public void setSeokeyword(String seokeyword) {
		this.seokeyword = seokeyword;
	}

	public String getSeodescr() {
		return seodescr;
	}

	public void setSeodescr(String seodescr) {
		this.seodescr = seodescr;
	}

	public int getHit() {
		return hit;
	}

	public void setHit(int hit) {
		this.hit = hit;
	}

	public String getSummay() {
		return summay;
	}

	public void setSummay(String summay) {
		this.summay = summay;
	}

	public String getSpecialid() {
		return specialid;
	}

	public void setSpecialid(String specialid) {
		this.specialid = specialid;
	}

	public String getEtdxml() {
		return etdxml;
	}

	public void setEtdxml(String etdxml) {
		this.etdxml = etdxml;
	}

	public String getTags() {
		return tags;
	}

	public void setTags(String tags) {
		this.tags = tags;
	}

	public Node getNode() {
		return node;
	}

	public void setNode(Node node) {
		this.node = node;
	}
	
	
	
	
	
	
}
